home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 013 / hiddir.arc / HIDDEN.DOC < prev    next >
Encoding:
Text File  |  1985-06-23  |  3.6 KB  |  65 lines

  1. Hidden.doc (pcs131 xa4)
  2.  
  3.    The three files MDS.COM,  CDS.COM,  and RDS.COM 
  4. are  trivial  programs  in  size  and  in  complexity,  but  they 
  5. illustrate  a technique for utilizing a form of file  protection: 
  6. locking   out  sub-directories  from  all  but   the   determined 
  7. knowledgeable user.  
  8.  
  9.    The  technique involves creating a subdirectory which has  the 
  10. ASCII  DELETE  character  (07FH)  as  the  first  letter  of  the 
  11. subdirectory's   name,   followed  by  up  to  7   user-specified 
  12. characters.   MDS (MakeDirectorySECRET) then sets the hidden 
  13. flag for the directory entry through the DOS CHMOD function call.  
  14. The  directory can only be set as the current directory by  using 
  15. CDS (ChangeDirectorySECRET) and can only be deleted by using 
  16. RDS (RemoveDirectorySECRET).  
  17.  
  18. ***************** PLEASE NOTE ***********************************
  19. THE ONLY SEQUENCE YOU HAVE TO TYPE TO USE ANY OF THESE COMMANDS
  20. IS  MDS , CDS , OR RDS .  THE SYSTEM WILL PROMPT YOU FURTHER....
  21. *****IMPORTANT****** PLEASE MAKE YOUR DIRECTORY NAMES AT LEASE
  22. THREE (3) CHARACTERS LONG  .EXAMPLE >  RWW  WOULD MAKE A DIRECTORY
  23. NAMES RWW... MAKE A NOTE OF IT FOR FURTHER USE... *********NOTE***
  24. ** ONE CHARACTER DIRECTORY NAMES MAY BE USED BUT *[ MUST ]* BE FOLLOWED
  25. BY 2 BLANK SPACES ENTERED BY THE SPACE BAR ON THE KEYBOARD
  26. >>>>>>>> OTHERWISE <<<<<<<<<<<< THE PROGRAM WILL ARBITRARILY APPEND
  27. "BC" TO YOUR ENTRY MAKING IT A THREE CHARACTER NAME.... HAVE A GOOD
  28. TIME WITH YOUR <<<<<<<<<<<<< SECRET >>>>>>>>>>>>>>...
  29.  
  30.    Of  course,  any  super-directory program which  shows  hidden 
  31. files   will  display  the  subdirectory  names  created  through 
  32. MDSECRET,  and a determined user could then use the knowledge  of 
  33. the  directory  name  to  write a program which  can  access  the 
  34. subdirectory (just like CDSECRET and RDSECRET do).   Without such 
  35. a  program,  the  user  will  not  even  know  the  name  of  the 
  36. subdirectory,  or even that it exists.   If the DELETE  character 
  37. were  not included in the file,  the user might try random  names 
  38. with  the CHDIR command,  eventually finding one and successfully 
  39. accessing it.   (Note that a hidden file is just as accessible as 
  40. a  visible one,  if you know its name!)  By including the  DELETE 
  41. character,  however,  the  user  will  not be  able  to  randomly 
  42. generate  the subdirectory name from the keyboard,  and will  not 
  43. even  be  able to issue the CHDIR command from the  keyboard  for 
  44. this subdirectory name.
  45.  
  46.    One important point on the use of the DOS CHMOD function :  It 
  47. doesn't  make  sense to try to change the "directory" bit in  the 
  48. attribute  word in a file's directory entry.   If the bit is  on, 
  49. then  the  file  was  created  as  a  sub-directory  node  (MKDIR 
  50. function);  if the bit is off,  then the file is a standard  data 
  51. file.  That much makes good sense.  What may not be as obvious is 
  52. that  you  MUST NOT set the directory bit when calling the  CHMOD 
  53. function,   even   if  the  file  in  question  is   actually   a 
  54. subdirectory.  DOS apparently checks to see if you have requested 
  55. setting  the directory bit before it "looks" at the file,  and it 
  56. exits  with an error (#5 -- Access Denied) if you have  this  bit 
  57. set.   The only bits which you are allowed to modify (as far as I 
  58. know)  are the archive bit,  the read/only bit,  the system  file 
  59. bit, and the hidden file bit.
  60.  
  61.    If  you  have any questions about these files,  feel  free  to 
  62. contact me through the PCSIG or EMAIL.  I don't always access the 
  63. PCSIG often to catch messages before they roll off, and this will 
  64. get worse in the near future,  as I am due to be transferred to a 
  65. new city